package com.putao.album.user;

import android.text.Html;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.putao.album.R;
import com.putao.album.base.BaseActivity;
import com.putao.album.util.ResourcesHelper;

/**
 * Created by jidongdong on 15/4/21.
 */
public class ActivityUserProtocal extends BaseActivity {
    private TextView tv_protocal, tv_title;
    private Button back_btn;

    @Override
    public int doGetContentViewId() {
        return R.layout.activity_user_protocal;
    }

    @Override
    public void doInitSubViews(View view) {
        queryViewById(R.id.right_btn).setVisibility(View.GONE);
        back_btn = queryViewById(R.id.back_btn, true);
        tv_protocal = queryViewById(R.id.tv_protocal);
        tv_title = queryViewById(R.id.title_tv);
        tv_title.setText(R.string.page_title_user_protocal);
        back_btn.setBackgroundResource(R.drawable.all_button_close);
    }

    @Override
    public void doInitData() {
        tv_protocal.setText(Html.fromHtml(getProtocalText()));
    }

    String getProtocalText() {
        return ResourcesHelper.getAssetTextFile("protocal.txt");
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.back_btn:
                finish();
                break;
        }
    }
}
